# !/usr/bin/env python
# encoding: utf-8


"""
  @author: gaogao
  @file: modelviewclient.py
  @time: 2021/6/3 17:47
  @desc:
"""

import sys

from PySide2.QtCore import QUrl
from PySide2.QtWidgets import (QApplication, QTreeView)
from PySide2.QtRemoteObjects import QRemoteObjectNode

if __name__ == '__main__':
    app = QApplication(sys.argv)
    node = QRemoteObjectNode(QUrl("local:registry"))
    node.setHeartbeatInterval(1000)
    view = QTreeView()
    view.setWindowTitle("RemoteView")
    view.resize(640, 480)
    model = node.acquireModel("RemoteModel")
    view.setModel(model)
    view.show()
    sys.exit(app.exec_())
